package com.nbsaas.boot.order.rest.convert;

import com.nbsaas.boot.order.data.entity.OrderLog;
import com.nbsaas.boot.order.api.domain.simple.OrderLogSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* -列表对象转换器
*/

public class OrderLogSimpleConvert implements Converter<OrderLogSimple, OrderLog> {




@Override
public OrderLogSimple convert(OrderLog source) {
    OrderLogSimple result = new OrderLogSimple();

                result.setNote(source.getNote());
                result.setId(source.getId());
                result.setUserName(source.getUserName());
                result.setUserId(source.getUserId());
                result.setAddDate(source.getAddDate());

               try {
                   if(source.getOrder()!=null){
                       result.setOrder(source.getOrder().getId());
                   }
                } catch (Exception ignored) { }

                result.setLastDate(source.getLastDate());


    return result;
}

}